package com.ruoyi.web.group.skill.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.web.group.skill.entity.SkillAssessment;
import com.ruoyi.web.group.skill.mapper.SkillAssessmentMapper;
import com.ruoyi.web.group.skill.service.SkillAssessmentService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SkillAssessmentServiceImpl
    extends ServiceImpl<SkillAssessmentMapper, SkillAssessment>
    implements SkillAssessmentService {

    @Override
    public List<SkillAssessment> listByPlayerId(Integer playerId) {
        return this.lambdaQuery()
                .eq(SkillAssessment::getPlayerId, playerId)
                .orderByDesc(SkillAssessment::getAssessmentDate)
                .list();
    }

    @Override
    public List<SkillAssessment> listBySkillType(Integer skillType) {
        return this.lambdaQuery()
                .eq(SkillAssessment::getSkillType, skillType)
                .orderByDesc(SkillAssessment::getAssessmentDate)
                .list();
    }
}